

#ifndef xrtc_endpoint_connector_hpp
#define xrtc_endpoint_connector_hpp

#include <functional>
#include <string>

#include "xrtc_endpoint.h"

typedef struct rtc_connector_st * rtc_connector_t;
typedef struct rtc_linker_st * rtc_linker_t;

rtc_connector_t rtc_connector_create(rtc_endpoint_t pub_rtc, int auto_free);

void rtc_connector_delete(rtc_connector_t obj);

rtc_linker_t rtc_connector_add_sub(rtc_connector_t obj, rtc_endpoint_t rtc, bool audio, bool video);

void rtc_connector_update_sub(rtc_connector_t obj, rtc_linker_t linker, bool audio, bool video);

int rtc_connector_remove_sub(rtc_connector_t obj, rtc_linker_t linker);

unsigned rtc_connector_sub_count(rtc_connector_t obj);

void rtc_connector_each_linker(rtc_connector_t obj, std::function<void(rtc_linker_t)> func);

rtc_endpoint_t rtc_linker_get_rtc(rtc_linker_t linker);

int rtc_connector_add_remote_sub(rtc_connector_t connector, const std::string& sub_rtc_id, bool audio, bool video, const std::string& remote_rtc_addr,
                                 int requireCheckRR, std::vector<uint32_t> sub_peer_audio_ssrcs, std::vector<uint32_t> sub_peer_video_ssrcs);

int rtc_connector_remove_remote_sub(rtc_connector_t connector, const std::string& sub_rtc_id);

uint32_t rtc_linker_get_video_remb(rtc_linker_t linker);

#endif /* xrtc_endpoint_connector_hpp */
